<script setup lang="ts">
// import timeline from 'src/assets/home/time-line.png'
// import timeline5 from 'src/assets/home/time-line-verticle.png'
import bg from '~/assets/home/home_3_04.jpg'
import h5bg from '~/assets/home/h5-home3.jpg'
import { timeLine } from '~/api'

const router = useRouter()
const { basicInfo } = storeToRefs(useTeamInfoStore())
const timelinepc = ref('')
const timelineapp = ref('')
timeLine({ scheduleId: basicInfo.value.scheduleId, type: 'PC' }).then((res) => {
  timelinepc.value = getAssetUrl(res.data.imgVo?.fileUrl)
})
timeLine({ scheduleId: basicInfo.value.scheduleId, type: 'APP' }).then((res) => {
  timelineapp.value = getAssetUrl(res.data.imgVo?.fileUrl)
})
const { isLogin } = storeToRefs(useTeamInfoStore())

function handleClick() {
  // 7.5日需求文档：该按钮跳转 ‘我要参赛页’，不需判断是否登录
  // router.push(isLogin.value ? '/user/profile' : '/register')
  router.push('/enter-competition')
}
</script>

<template>
  <PageItem :bg="bg" :h5bg="h5bg" title="大赛时间" :content-style="{ flex: 1 }">
    <div class="h-full w-full" m="b-1/10" p="t-1/10" flex="~ col justify-center items-center">
      <img :src="timelinepc" w-full object-contain lt-lg:hidden>
      <img :src="timelineapp" w-full object-contain lg:hidden>

      <div text="center" w="full" m="t-4vw">
        <div btn @click="handleClick">
          我要参赛
        </div>
      </div>
    </div>
  </PageItem>
</template>

<style scoped>

</style>
